Skip to content

Improve IDisposable note#12752

Merged
gewarren merged 3 commits into
dotnet:mainfrom
gewarren:idisposable
Jun 18, 2026
Merged

Improve IDisposable note#12752
gewarren merged 3 commits into
dotnet:mainfrom
gewarren:idisposable

Conversation

@gewarren

Copy link
Copy Markdown
Collaborator

Fixes #12628.

@github-actions github-actions Bot added the area-Meta Concerns something that extends across runtime area boundaries, for example, IDisposable. label Jun 16, 2026
@gewarren gewarren marked this pull request as ready for review June 17, 2026 14:54
@gewarren gewarren requested a review from a team as a code owner June 17, 2026 14:54
Copilot AI review requested due to automatic review settings June 17, 2026 14:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates .NET API reference ECMAXML docs to reduce repeated disposal boilerplate in individual types by improving the canonical guidance on System.IDisposable and having implementing types point readers to that section instead.

Changes:

  • Refined the guidance and links in System.IDisposable docs, including updated section titles and cross-references.
  • Replaced lengthy per-type “implements IDisposable” boilerplate with shorter text that links back to the IDisposable remarks.
  • Cleaned up callout formatting and some Markdown/table formatting in several reference topics.

Reviewed changes

Copilot reviewed 50 out of 52 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
xml/System/IDisposable.xml Updates IDisposable remarks and adds reusable “Use an object…” guidance (also introduces a new in-page link that needs correction).
xml/System.Timers/Timer.xml Replaces long IDisposable boilerplate with a short pointer to the IDisposable guidance; cleans callout formatting and a Markdown table.
xml/System.Threading/WaitHandle.xml Minor wording update to IDisposable callout (still mentions try/catch, should be try/finally).
xml/System.Threading/ReaderWriterLockSlim.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Threading/Mutex.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Threading/CancellationTokenSource.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Threading/AutoResetEvent.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.Security/SecureString.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.Security.Principal/WindowsIdentity.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Security.Cryptography/SHA1CryptoServiceProvider.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.Security.Cryptography/RNGCryptoServiceProvider.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.Security.Cryptography.X509Certificates/X509Store.xml Replaces per-type boilerplate with pointer to IDisposable guidance (multiple locations).
xml/System.Security.Cryptography.X509Certificates/X509Chain.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.Security.Cryptography.X509Certificates/X509Certificate.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Runtime/MemoryFailPoint.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Resources/ResourceWriter.xml Replaces per-type boilerplate with pointer to IDisposable guidance and removes extra blank lines.
xml/System.Resources/ResourceSet.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.Resources/ResourceReader.xml Replaces per-type boilerplate with pointer to IDisposable guidance (but loses IMPORTANT callout formatting).
xml/System.IO/TextWriter.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.IO/TextReader.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.IO/StreamWriter.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.IO/StreamReader.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.IO/Stream.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.IO/FileStream.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.IO/BufferedStream.xml Replaces per-type boilerplate with pointer to IDisposable guidance and removes extra blank lines.
xml/System.IO/BinaryWriter.xml Replaces per-type boilerplate with pointer to IDisposable guidance and removes extra blank lines.
xml/System.IO/BinaryReader.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.IO.IsolatedStorage/IsolatedStorageFileStream.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.IO.IsolatedStorage/IsolatedStorageFile.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Diagnostics/TextWriterTraceListener.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Diagnostics/ProcessThread.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Diagnostics/ProcessModule.xml Replaces per-type boilerplate with pointer to IDisposable guidance and normalizes callout spacing.
xml/System.Diagnostics/Process.xml Normalizes callout spacing in several NOTE blocks.
xml/System.Diagnostics/EventLogEntry.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.Diagnostics/DelimitedListTraceListener.xml Normalizes callout spacing in several NOTE/IMPORTANT blocks.
xml/System.ComponentModel.Composition/ExportLifetimeContext`1.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Primitives/ComposablePartCatalog.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/TypeCatalog.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/ImportEngine.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/FilteredCatalog.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/DirectoryCatalog.xml Replaces boilerplate with pointer to IDisposable guidance (but loses IMPORTANT callout formatting).
xml/System.ComponentModel.Composition.Hosting/CompositionService.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/CompositionScopeDefinition.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/CompositionContainer.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/ComposablePartExportProvider.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/CatalogExportProvider.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/AtomicComposition.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/AssemblyCatalog.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/ApplicationCatalog.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/AggregateExportProvider.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.ComponentModel.Composition.Hosting/AggregateCatalog.xml Replaces per-type boilerplate with pointer to IDisposable guidance.
xml/System.Collections.Concurrent/BlockingCollection`1.xml Reworks remarks/callout formatting for IDisposable guidance (introduces a missing space between sentences).

Comment thread xml/System/IDisposable.xml Outdated
Comment thread xml/System.Threading/WaitHandle.xml Outdated
Comment thread xml/System.Resources/ResourceReader.xml Outdated
Comment thread xml/System.ComponentModel.Composition.Hosting/DirectoryCatalog.xml Outdated
Comment thread xml/System.Collections.Concurrent/BlockingCollection`1.xml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@BillWagner BillWagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM.

Let's :shipit:

@gewarren gewarren merged commit fd8448f into dotnet:main Jun 18, 2026
6 checks passed
@gewarren gewarren deleted the idisposable branch June 18, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Meta Concerns something that extends across runtime area boundaries, for example, IDisposable.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve IDisposable note

3 participants